﻿/**********************************************************************
* @file   FITKAcousticsSEASubSysMgrAdaptor.h
* @brief  子系统管理器数据 读写适配器
* @author yangjing (1195810980@qq.com)
* @date   2025-02-25
*********************************************************************/
#ifndef _FITFK_ACOUSTICS_SEA_SUB_SYS_MGR_MODEL_ADAPTOR_H___
#define _FITFK_ACOUSTICS_SEA_SUB_SYS_MGR_MODEL_ADAPTOR_H___

#include "FITKAcousticsAbstractAdaptor.h"
#include "FITK_Kernel/FITKCore/FITKCoreMacros.h"
#include "FITK_Kernel/FITKAdaptor/FITKIOAdaptorFactory.h"
#include "FITK_Component/FITKAcousticsModel/FITKAcousticsSEAModel.h"
#include "FITK_Component/FITKAcousticsModel/FITKAbstractSEASubSysWithNodes.h"
#include "FITK_Component/FITKAcousticsModel/FITKSEASubSysBeamWare.h"
#include <H5Cpp.h>

namespace IO {
    class FITKHDF5FileTool;
    class FITKAbstractSEASubSys;
    class FITKAbstractSEASubSysWithNodes;
    class FITKSEASubSysBeamWare;
}
namespace Acoustics {
    class FITKSEASubSysBeam;
    class FITKAbstractSEASubSys;
    class FITKSEASubSysShellRadiationWare;
    class FITKAbstractSEASubSysShell;
}

namespace IO
{
    class FITKAcousticsHDF5IOAPI FITKAcousticsSEASubSysMgrAdaptor : public FITKAcousticsAbsAdaptor
    {
    public:
        explicit FITKAcousticsSEASubSysMgrAdaptor() = default;
        virtual ~FITKAcousticsSEASubSysMgrAdaptor() = default;

        virtual bool adaptR() override;

        virtual bool adaptW() override;

    private:



        /**
        * @brief 读声腔系统
        * @param @param[i]  gp hdf5组别
        * @param @param[i]  mager    子系统管理器
        * @author yangjing (1195810980@qq.com)
        * @date 2024-1-13
        */
        bool readSEACavitys(H5::Group & gp, Acoustics::FITKAcousticsSEASubSysManager * mager);
        /**
        * @brief 写声腔系统到hdf5
        * @param @param[i]  gp hdf5组别
        * @param @param[i]  SEACavitys    声腔子系统数据
        * @author yangjing (1195810980@qq.com)
        * @date 2024-1-13
        */
        bool writeSEACavitys(H5::Group &gp, QList<Acoustics::FITKAbstractSEASubSys*>SEACavitys);
        
        /**
        * @brief 读双曲率板
        * @param @param[i]  gp hdf5组别
        * @param @param[i]  mager    子系统管理器
        * @author yangjing (1195810980@qq.com)
        * @date 2024-1-13
        */
        bool readDoublyCurvedShells(H5::Group & gp, Acoustics::FITKAcousticsSEASubSysManager * mager);


        /**
        * @brief 写半无限流体数据到hdf5
        * @param @param[i]  gp hdf5组别
        * @param @param[i]  SemiIInfiniteFluids    半无限流体数据
        * @author yangjing (1195810980@qq.com)
        * @date 2024-1-13
        */
        bool writeSemiIInfiniteFluids(H5::Group &gp, QList<Acoustics::FITKAbstractSEASubSys*>SemiIInfiniteFluids);

        /**
        * @brief 读半无限流体数据
        * @param @param[i]  gp hdf5组别
        * @param @param[i]  mager    子系统管理器
        * @author yangjing (1195810980@qq.com)
        * @date 2024-1-14
        */
        bool readSemiIInfiniteFluids(H5::Group & gp, Acoustics::FITKAcousticsSEASubSysManager * mager);


        /**
        * @brief 写双曲率板数据到hdf5
        * @param @param[i]  gp hdf5组别
        * @param @param[i]  SinglyCurvedShells    单曲率板数据
        * @author yangjing (1195810980@qq.com)
        * @date 2024-1-13
        */
        bool writeDoublyCurvedShells(H5::Group &gp, QList<Acoustics::FITKAbstractSEASubSys*>SEADoublyCurvedShells);

        /**
        * @brief 写单曲率板数据到hdf5
        * @param @param[i]  gp hdf5组别
        * @param @param[i]  SinglyCurvedShells    单曲率板数据
        * @author yangjing (1195810980@qq.com)
        * @date 2024-1-13
        */
        bool writeSinglyCurvedShells(H5::Group &gp, QList<Acoustics::FITKAbstractSEASubSys*>SinglyCurvedShells);


        /**
        * @brief 读单曲率板
        * @param @param[i]  gp hdf5组别
        * @param @param[i]  mager    子系统管理器
        * @author yangjing (1195810980@qq.com)
        * @date 2024-1-13
        */
        bool readSinglyCurvedShells(H5::Group & gp, Acoustics::FITKAcousticsSEASubSysManager * mager);


        /**
        * @brief 写平板子系统到hdf5
        * @param @param[i]  gp hdf5组别
        * @param @param[i]  FlatPlates    平板子系统数据
        * @author yangjing (1195810980@qq.com)
        * @date 2024-1-8
        */
        bool writeSEAFlatPlates(H5::Group &gp, QList<Acoustics::FITKAbstractSEASubSys*>FlatPlates);


        /**
        * @brief 读hdf5到平板子系统
        * @param @param[i]  gp hdf5组别
        * @param @param[i]  mager    子系统管理器
        * @author yangjing (1195810980@qq.com)
        * @date 2024-1-8
        */
        bool readSEAFlatPlates(H5::Group & gp, Acoustics::FITKAcousticsSEASubSysManager * mager);


        /**
        * @brief 读梁子系统数据
        * @param @param[i]  gp hdf5组别
        * @param @param[i]  mager    子系统管理器数据
        * @author yangjing (1195810980@qq.com)
        * @date 2024-1-7
        */
        bool readSEABeams(H5::Group & gp, Acoustics::FITKAcousticsSEASubSysManager * mager);

        /**
        * @brief 写梁子系统到hdf5
        * @param @param[i]  gp hdf5组别
        * @param @param[i]  SEABeams    梁子系统数据
        * @author yangjing (1195810980@qq.com)
        * @date 2024-1-7
        */
        bool writeSEABeams(H5::Group gp, QList<Acoustics::FITKAbstractSEASubSys*>SEABeams);//写梁子系统
    private:


        /**
        * @brief 读FITKAbstractSEASubSysWithNodes hdf5数据
        * @param @param[i]  gp        hdf5组别
        * @param @param[i]  p 父类之一
        * @author yangjing (1195810980@qq.com)
        * @date 2024-1-7
        */
        bool readSEASubSysWithNodes(H5::Group&gp, Acoustics::FITKAbstractSEASubSysWithNodes *p);


        /**
        * @brief 写FITKAbstractSEASubSysWithNodes到hdf5
        * @param @param[i]  gp hdf5组别
        * @param @param[i]  p   梁子系统的一个父类
        * @author yangjing (1195810980@qq.com)
        * @date 2024-1-7
        */
        bool writeSEASubSysWithNodes(H5::Group gp, Acoustics::FITKAbstractSEASubSysWithNodes *p);


        /**
        * @brief 写FITKAbstractSEASubSysShell到hdf5
        * @param @param[i]  gp hdf5组别
        * @param @param[i]  p   SubSysShell
        * @author yangjing (1195810980@qq.com)
        * @date 2024-1-13
        */
        bool writeSEASubSysShell(H5::Group &gp, Acoustics::FITKAbstractSEASubSysShell*SubSysShell);

        /**
        * @brief 读FITKAbstractSEASubSysShell
        * @param @param[i]  gp hdf5组别
        * @param @param[i]  p   SubSysShell
        * @author yangjing (1195810980@qq.com)
        * @date 2024-1-13
        */
        bool readSEASubSysShell(H5::Group &gp, Acoustics::FITKAbstractSEASubSysShell*SubSysShell);


        /**
        * @brief 写FITKSEASubSysShellRadiationWare到hdf5
        * @param @param[i]  gp hdf5组别
        * @param @param[i]  SubSysShellRadiationWare   父类指针
        * @author yangjing (1195810980@qq.com)
        * @date 2024-1-7
        */
        bool writeSEASubSysShellRadiationWare(H5::Group &gp, Acoustics::FITKSEASubSysShellRadiationWare*SubSysShellRadiationWare);


        /**
        * @brief 读FITKSEASubSysShellRadiationWare
        * @param @param[i]  gp hdf5组别
        * @param @param[i]  SubSysShellRadiationWare   父类指针
        * @author yangjing (1195810980@qq.com)
        * @date 2024-1-7
        */
        bool readSEASubSysShellRadiationWare(H5::Group &gp, Acoustics::FITKSEASubSysShellRadiationWare*SubSysShellRadiationWare);

        /**
        * @brief 写FITKAbstractSEASubSys子系统抽象类数据到hdf5
        * @param @param[i]  gp hdf5组别
        * @param @param[i]  SEACavitys   子系统抽象类
        * @author yangjing (1195810980@qq.com)
        * @date 2024-1-13
        */
        bool writeSEASubSys(H5::Group &gp, Acoustics::FITKAbstractSEASubSys*subSysp);

        /**
        * @brief 写子系统抽象类
        * @param @param[i]  gp hdf5组别
        * @param @param[i]  SEACavitys   子系统抽象类
        * @author yangjing (1195810980@qq.com)
        * @date 2024-1-13
        */
        bool readSEASubSys(H5::Group &gp, Acoustics::FITKAbstractSEASubSys*subSysp);

    private:
        IO::FITKHDF5FileTool*m_toolp{ nullptr };
    };
    Register2FITKIOAdaptorFactory(FITKAcousticsHDF5, Acoustics::FITKAcousticsSEASubSysManager, FITKAcousticsSEASubSysMgrAdaptor);
}


#endif
